<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/10/18 0018
 * Time: 12:02
 */

namespace Api\Controller;
use Think\Controller;

class IndexController extends CommonController
{

    public function index(){
        $class_id = 13;
        $list =  M()->table('agency_goods_list a1')
            ->join('agency_goods_price a2 on a1.goods_id=a2.goods_id')
            ->where(array('a1.class_id'=>$class_id,'a1.state'=>1))
            ->field('a1.goods_id,a2.price,a1.goods_name,
                a1.goods_img,a1.goods_intro,a1.attribute,a1.volume,a2.region_id')
            ->select();
        dump($list);die;
        $this->ajaxReturn($list,'json');
    }
    public function article(){
       $column_id = 1;
       $data = M()->table('agency_article_column a1')
           ->join('agency_article_list a2 on a1.column_id = a2.column_id')
           ->where(array('a1.parent_column_id'=>$column_id,'a1.state'=>1))
           ->select();
       $model = D('ArticleColumn');
       $res = $model->getChildren($data,$column_id);

       dump($res);die;
    }





}